#[macro_use]
pub mod debug {
    pub fn type_of<T>(_: &T) -> &str {
        std::any::type_name::<T>()
    }

    #[macro_export]
    macro_rules! dbgt {
        ($val:expr) => {
            match $val {
                tmp => {
                    eprintln!(
                        "[{}:{}] ({}: {}) = {:#?}",
                        file!(),
                        line!(),
                        stringify!($val),
                        $crate::type_of(tmp), // not $val, &tmp
                        &tmp
                    );
                    tmp
                }
            }
        };
    }
}
